<script type="text/javascript">
    $(function(){
        try {
            $("#progress").show();
            $.ajax({
                type: "POST",
                url : "../controllers/ObjetoController.php",
                data : {
                    acao : 'listar',
                    tipo_listagem : 'tabela'
                },
                success: function(msg){
                    try {
                        if (msg.indexOf("Exception: ") != -1) {
                            msg = msg.replace("Exception: ", "");
                            showMessage(ERROR_MESSAGE, msg);
                            return;
                        }
                        $("#tabela_objeto_tbody").html(msg);
                        $("#principal_content_title").html("Listagem de Objeto");
                        $('#tabela_objeto').dataTable({
                            "sDom": '<"H"lfr>t<"F"ip>T',
                            "bJQueryUI": true,
                            "sPaginationType": "full_numbers",
                            "bProcessing": true,
                            "bAutoWidth": false,
                            "oLanguage": {
                                "sUrl": "../resources/json/pt_BR.json"
                            }
                        });
                        $('#tabela_objeto').parent().show();
                        $("#progress").hide();
                    } catch(e) {
                        reportCrash(null, e.name, e.stack);
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    $("#progress").hide();
                    reportCrash(XMLHttpRequest, textStatus, errorThrown);
                }
            });
        } catch(e) {
            reportCrash(null, e.name, e.stack);
        }
    });
</script>
<br/>
<div class="dt_example">
    <table cellpadding="0" cellspacing="0" border="0" id="tabela_objeto" class="display">
        <thead>
            <tr>
                <th>Posto/Grad</th>
                <th>Nome</th>
                <th>Telefone</th>
                <th>Email</th>
                <th>Institui&ccedil;&atilde;o</th>
            </tr>
        </thead>
        <tbody id="tabela_objeto_tbody">
        </tbody>
    </table>
</div>
<br/>